package model

import (
	"gorm.io/gorm"
	"time"
)

type Model struct {
	ID        int64          `gorm:"primarykey"`
	CreatedAt time.Time      `gorm:"created_at"`
	UpdatedAt time.Time      `gorm:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type UserInfo struct {
	Model
	Platform    string    `gorm:"platform"`
	OpenId      string    `gorm:"open_id"`
	UnionId     string    `gorm:"union_id"`
	LastLoginAt time.Time `gorm:"last_login_at"`
}

type ShortLink struct {
	Model
	UserInfoId   int64     `gorm:"user_info_id"`
	LongUrl      string    `gorm:"long_url"`
	LongUrlMd5   string    `gorm:"long_url_md5"`
	ShortUrl     string    `gorm:"short_url"`
	ShortUrlPart string    `gorm:"short_url_part"`
	ExpiredAt    time.Time `gorm:"expired_at"`
}
